<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="umsroot.css">
<TITLE>
Soft Cut
</TITLE>
</HEAD>
<BODY >
<A HREF="umsroot026.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="umsroot021.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc58">5.6</A>&nbsp;&nbsp;Soft Cut</H2>
Sometimes it is useful to be able to remove a choice point which is
not the last one and to keep the following ones, for example
when defining an if-then-else construct which backtracks also
into the condition.
This functionality is usually called <I>soft cut</I> in the Prolog
folklore.<BR>
<BR>
Softcuts are written as:
<BLOCKQUOTE CLASS="quote">
<B>A *&minus;&gt; B ; C</B>
</BLOCKQUOTE>
If A succeeds, B is executed and on backtracking subsequent
solutions of A followed by B are returned, but C is never executed.
If A fails straight away, C is executed.
The behaviour of <A HREF="../bips/kernel/control/X-G-2.html"><B>*&minus;&gt;/2</B></A><A NAME="@default197"></A>
is similar to <A HREF="../bips/kernel/control/-G-2.html"><B>&minus;&gt;/2</B></A><A NAME="@default198"></A>
with the exception that <B>&minus;&gt;/2</B>
cuts both A and the disjunction if A succeeds, whereas
<A HREF="../bips/kernel/control/X-G-2.html"><B>*&minus;&gt;/2</B></A><A NAME="@default199"></A>
cuts only the disjunction.<BR>
<BR>
<HR>
<A HREF="umsroot026.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="umsroot021.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
</BODY>
</HTML>
